local thbattle__xiaoting_guihang = fk.CreateSkill {

  name = "thbattle__xiaoting_guihang",

  tags = { Skill.Wake, },

}



thbattle__xiaoting_guihang:addEffect(fk.EventPhaseStart, {
  anim_type = "big",
  can_trigger = function(self, event, target, player, data)
    return target == player and player:hasSkill(thbattle__xiaoting_guihang.name) and player.phase == Player.Start and
        player:usedSkillTimes(thbattle__xiaoting_guihang.name, Player.HistoryGame) == 0
  end,
  can_wake = function(self, event, target, player, data)
    return player.hp < #player:getCardIds("h") and player.hp <= 2
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    room:changeMaxHp(player, -1)
    room:handleAddLoseSkills(player, "thbattle__xiaoting_duqian")
  end
})

return thbattle__xiaoting_guihang